var DAO = require('./DAO')
//针对用户数据表操作的模块对象
var searchDAO = {
    //模糊搜索
    searchContent: function (searchName,callback) {
        DAO('select mealId,mealTitle,menuName from mm join (menu,meal) on mm.tomenuId = menu.menuId and mm.tomealId = meal.mealId where mealId in(select meal.mealId from mm join menu on mm.tomenuId=menu.menuId left join meal on mm.tomealId=meal.mealId where menu.menuName like "%"?"%") order by meallikeNum desc', [searchName], function (err, results) {
           console.log(results)
            if (err) {
                callback(err, null)
            } else {
                callback(null, results)
            }
        })
    },

 }
module.exports = searchDAO